package com.hq.tomato.ms.config;

import com.hq.tomato.ms.strategy.MongoDbDlqStrategy;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 *
 *
 * @Description: <br> 特殊策略的自动装配 特殊是指需要依赖第三方组件的策略
 * @Project: <br>
 * @CreateDate: Created in 2019-11-20 19:58 <br>
 * @Author: <a href="1026365768@qq.com">qiang.hu</a>
 */
@ConditionalOnClass(MongoTemplate.class)
public class TomatoMsSpecialStrategyAutoConfiguration {

    /**
     * @Author huqiang
     * @Description //TODO mongo入库策略 依赖于MongoDBUtil
     * @Date  2019-11-20
     * @Param
     * @return com.hq.tomato.ms.strategy.MongoDbDlqStrategy
     */
    @Bean(name = "dlq.process.db")
    @ConditionalOnClass(MongoTemplate.class)
    public MongoDbDlqStrategy mongoDbDlqStrategy(){
        return new MongoDbDlqStrategy();
    }

}
